<?php

/**
 * 前台访问控制器类
 * 
 * @package    01CMS
 * @subpackage www
 * @author     rolong at vip.qq.com
 * @version    1.0.0
 * @link       http://www.01cms.com
 */

class UserController extends Controller
{
    public $User;
    public $templateDir;

    function __construct ()
    {
        parent::__construct();
        $this->templateDir = ROOT_PATH . '/template/' . $this->Load->var['style'];
        $this->User = model('User');
        if ($this->m != 'login')
        {
            $this->User = model('User');
            if (! $this->User->isLogined())
            {
                redirect('user/login');
            }
        }
    }

    function login ()
    {
        $data['username']='admin';
        $data['password']='admin';
        if ($this->User->login($data))
        {
            response('登陆成功', TRUE);
        }
        else
        {
            response(model('User')->getError());
        
        }
    }

    function index ()
    {
        echo 'aa';
    }
}